/*科研管理员审核 */
<template>
  <div style="color: #ebebeb;height:1000px">
    <el-row>
        <el-col :span="24">
                <el-card class="box-card">
                    <div class="text item">
                        <el-row class="el-row_color">
                        <el-col :span="24">
                            <span style="color:blue;font-size: 20px;">审核</span>
                        </el-col>
                        </el-row>
                        <br/>
                        <hr/>
                        <el-row class="el-row_color">
                        <el-col :span="24">
                            <span style="color:blue;font-size: 15px;">审核</span>
                        </el-col>
                        </el-row>
                        <br/>
                        <el-row class="el-row_color">
                          <el-col :span="24">
                            <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" @selection-change="handleSelectionChange">
                              <el-table-column prop="billingUnit" label="来款单位"></el-table-column>
                              <el-table-column prop="billingBank" label="银行卡号"></el-table-column>
                              <el-table-column prop="billingMoney" label="到账金额"></el-table-column>
                            </el-table>
                          </el-col>
                        </el-row>
                        <br/>
                        <el-row class="el-row_color">
                                  <el-col :span="2">
                                        <div>
                                            <span>结果类型：</span>
                                        </div>
                                    </el-col>
                                    <el-col :span="22">
                                        <el-select v-model="Info.Outcome" placeholder="请选择">
                                            <el-option label="通过" value="true"></el-option>
                                            <el-option label="退回" value="false"></el-option>
                                        </el-select>
                                    </el-col>
                        </el-row>
                        <br/>
                        <el-row class="el-row_color">
                            <el-col :span="24">
                                <div v-show="Info.Outcome=='true'">
                                    <el-row>
                                        <el-col :span="2">
                                            <div>
                                                <span>通过原因：</span>
                                            </div>
                                        </el-col>
                                        <el-col :span="20">
                                            <el-input type="textarea" rows="5" v-model="Info.remark"></el-input>
                                        </el-col>
                                    </el-row>
                                </div>
                                <div v-show="Info.Outcome=='false'">
                                    <el-row>
                                        <el-col :span="2">
                                            <div>
                                                <span>退回步骤：</span>
                                            </div>
                                        </el-col>
                                        <el-col :span="20">
                                            <el-select v-model="Info.orderId" placeholder="请选择">
                                                <el-option label="科研人员" value="2"></el-option>
                                            </el-select>
                                        </el-col>
                                    </el-row>
                                    <br/>
                                    <el-row>
                                        <el-col :span="2">
                                            <div>
                                                <span>退回原因：</span>
                                            </div>
                                        </el-col>
                                        <el-col :span="20">
                                            <el-input type="textarea" rows="5" v-model="Info.remark"></el-input>
                                        </el-col>
                                    </el-row>
                                </div>
                            </el-col>
                        </el-row>
                    </div>
                </el-card>
                 <br/>
                <el-row style="margin-left: 1000px;">
                    <el-col :span="24">
                        <el-form-item>
                            <el-button type="primary" @click="submitForm()">保存</el-button>
                        </el-form-item>
                    </el-col>
                </el-row>
        </el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  props: { id: undefined },
  data() {
    return {
        tableData:[],
        Info:{
            billingId:this.$route.query.id,             //入账单主键
            Outcome:'',                                 //结果类型
            remark:'',                                  //通过原因、退回原因
            orderId:'',                                 //退回步骤(返回的节点)
        }
    }
  },
  created() {
    this.dataedit()
  },
  methods: {
    submitForm(){
        this.http.post("api/tb_project_workflowstep/newAccountAdd",this.Info).then((res=>{
            if(res.status){
                //弹出提示信息
                this.$message.success('审核结束！正在跳转页面');
                this.$router.push('/tb_project_billingList?id='+this.$route.query.id)
            }
            else{
                this.$message.error();('审核出错了！请重试！！');
            }
        }))
    },
    //详情
    dataedit() {
      this.http
        .get("/api/tb_project_billing/GetDetailBiilling?id=" + this.$route.query.id)
        .then((res) => {
          this.tableData = res.data;
        });
    },
  },
}
</script>

<style>
.el-row_color{
    margin-left: 30px;
    
}
</style>
